<template>
	<view>
		<News :myprop="list" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			};
		},
		onLoad() {
			let _this = this
			uni.request({
				url:"http://localhost:8000/api/news",
				method:'GET',
				success(res) {
					console.log('res',res.data);
					_this.list= res.data.data
					console.log('更多数据',_this.list);
					// this.$emit('child-event', { message: 'Hello from the child component!' });
				}
			})
		},
		methods: {
			toDetail() {
				
				let json = JSON.stringify(this.list)
				let jsoncode = encodeURIComponent(json)
				uni.navigateTo({
					url: '/pages/index/TravelDetail/TravelDetail?detail=' + jsoncode,
				});
			}
		}
	}
</script>

<style lang="scss">
	
</style>